'use strict'

const Koa = require('koa')
const bodyparser = require('koa-bodyparser')
const cors = require('koa-cors')
const router = require('./router')
const { sync } = require('./model');

let app = new Koa();

// 调用包装后的模型同步函数
// sync();

app.use(bodyparser())
app.use(cors())
app.use(router.routes())

let port = 8000;
app.listen(port)
console.log(`Server is running http://localhost:8000`);
